package com.vr.cloudpicture.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 空间级别枚举
 *
 * @author hzh
 * @date 2025/05/18
 */
@Getter
@AllArgsConstructor
public enum SpaceLevelEnum {

    COMMON("普通版",0,100L,100L*1024*1024),
    PROFESSIONAL("专业版",1,1000L,1000L*1024*1024),
    FLAGSHIP("旗舰版",2,10000L,10000L*1024*1024);

    private final String text;
    private final Integer value;
    private final Long maxCount;
    private final Long maxSize;

    /**
     * 根据value获取枚举
     *
     * @param value 价值
     * @return {@code SpaceLevelEnum }
     */
    public static SpaceLevelEnum getEnumByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (SpaceLevelEnum anEnum : SpaceLevelEnum.values()) {
            if (anEnum.value.equals(value)) {
                return anEnum;
            }
        }
        return null;
    }
}
